﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {


        if (CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.IsCXLive") == "1")
        {
            //Response.Redirect("~/");
        }


        if (!Page.IsPostBack)
        {
            string[] languages = HttpContext.Current.Request.UserLanguages;
            if (languages != null && languages.Length != 0)
            {
                string _logSting = "Security page first time loaded. Language = ";
                for (int i = 0; i < languages.Length; i++)
                {
                    _logSting += "[" + languages[i].ToString() + "] ";
                }
            }
            else
            {
            }
        }
    }

    protected void btnSignIn_Click(object sender, EventArgs e)
    {
        if (IsValid)
        {
            if (TextBox1.Text == CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.AdminID"))
            {
                if (TextBox2.Text == CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.AdminPass"))
                {
                    Session[CE.Global.General.Guest] = "Admin";
                    Response.Redirect("home");
                }
                else
                {
                    lblMessage.Text = "Ooops, please try again.<br/>You keyed something wrong.";
                }
            }
            else
            {
                lblMessage.Text = "Ooops, please try again.<br/>You keyed something wrong.";
            }
        }
        else
        {
        }
    }

}
